﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using CooWork.Models;

namespace CooWork.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            ViewBag.Message = "Welcome !";

            return View();
        }


        /// <summary>
        /// user table
        /// </summary>
        /// <param name="name"></param>
        /// <param name="parentId"></param>
        /// <returns></returns>
        public PartialViewResult ddlstatus(string name, int? id)
        {
            var ddlist = new _DropDownModel();
            ddlist.SelectedID = id ?? -1;
            ddlist.Name = string.IsNullOrWhiteSpace(name) ? ddlist.Name : name;
            ddlist.ddlStatus();
            return PartialView(ddlist);
        }







        public PartialViewResult ddlpriority(string name, int? priority)
        {
            var ddlist = new _DropDownModel();
            ddlist.SelectedID = priority ?? -1;
            ddlist.Name = string.IsNullOrWhiteSpace(name) ? ddlist.Name : name;
            ddlist.ddlpriority();
            return PartialView(ddlist);
        }

        public PartialViewResult ddlseverity(string name, int? severity)
        {
            var ddlist = new _DropDownModel();
            ddlist.SelectedID = severity ?? -1;
            ddlist.Name = string.IsNullOrWhiteSpace(name) ? ddlist.Name : name;
            ddlist.ddlseverity();
            return PartialView(ddlist);
        }



        public ActionResult About()
        {
            return View();
        }
    }
}
